home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / SHARED.DIR / 03085_Script_SOUND HANDLERS < prev    next >
Text File  |  1996-04-01  |  2KB  |  69 lines

  1. -- -----------------------------------------------------------
  2. -- Handler stopVoice stops the sound in channel 2 and fades the
  3. -- sound in channel 1.
  4.  
  5. on stopVoice
  6.   sound stop 2
  7.   put the volume of sound 1 into startVol
  8.   
  9.   if (StartVol > 0) then
  10.     put the ticks into startTicks
  11.     
  12.     repeat with N = 0 to startVol
  13.       set the volume of sound 1 to startVol - N
  14.       updateStage
  15.       -- In case of problem, get out of here after 90 ticks:
  16.       if (the ticks > startTicks + 90) then exit repeat
  17.     end repeat
  18.   end if
  19.   
  20.   sound stop 1
  21.   set the volume of sound 1 to 255
  22. end
  23.  
  24. -- -----------------------------------------------------------
  25. -- Handler waitVoice plays the sound in channel 1 allowing it
  26. -- to be interruptable by a mouseclick.
  27.  
  28. on WaitVoice
  29.   repeat while (not (the mouseDown)) and (soundBusy(1))
  30.     updateStage
  31.   end repeat
  32.   --  puppetSound 0
  33. end
  34.  
  35. -- -----------------------------------------------------------
  36. -- Handler playLoadingSound plays a loading sound.
  37.  
  38. on playLoadingSound
  39.   playSpecificLoadingSound ""
  40. end
  41.  
  42. on stopPlayingLoadingSound
  43.   puppetSound 0  
  44. end
  45.  
  46. -- -----------------------------------------------------------
  47. -- Handler playSpecificLoadingSound plays the given loading sound.
  48. -- If the loading sound is empty, it plays a random loading sound.
  49.  
  50. on playSpecificLoadingSound whichSound
  51.   exit -- Removed as per Harry's instructions March 18, 1996
  52.   stopVoice
  53.   
  54.   if (whichSound = empty) or voidP(whichSound) then put "MISC" & string(random(4)) into whichSound
  55.   
  56.   put "LS_" & (char 1 to 5 of whichSound) & ".AIF" into TransSound
  57.   puppetSound TransSound
  58.   updateStage
  59. end
  60.  
  61. -- -----------------------------------------------------------
  62. -- Handler waitSoundInChannel plays an interruptable sound in
  63. -- the given sound channel.
  64.  
  65. on waitSoundInChannel whichChannel
  66.   repeat while  (not (the mouseDown)) and (soundBusy(whichChannel))
  67.     updateStage
  68.   end repeat
  69. end